package com.situ.day3;

//实体类: 和表一一对应
//类的内部
public class Student {
    //属性 field
    int id;
    String name;
    int age;
    String gender;//男、女

    //方法 小驼峰、动词开头
    public String getInfo() {
        //String str = "[Student: id=1,name=zhangsan,age=23,gender=男]";
        //String str = "[Student: id="+id+",name="+name+",age="+age+",gender="+gender+"]";
        //return str;
        return "[Student: id="+id+",name="+name+",age="+age+",gender="+gender+"]";
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                '}';
    }
}
